package com.kajespero.dao.commons;

import java.util.Collection;
import java.util.Map;

import com.kajespero.vo.IdentifierVO;
import com.kajespero.vo.VO;

public interface PersistManager {
	
	public <T extends IdentifierVO<?>, Id extends Comparable<?>> T find(Class<T>clazz, Id identifier);
	
	public <T extends IdentifierVO<Id>, Id extends Comparable<Id>> Collection<T> findAll(Class<T> clazz);
	
	public <T extends IdentifierVO<?>> T findBy(Class<T> clazz, Map<String, Object> values);
	
	public <T extends IdentifierVO<?>> void saveOrUpdare(T instance);
	
	public <T extends IdentifierVO<?>> void delete(T instance);
	
	public <Id extends Comparable<?>, T extends IdentifierVO<?>> void delete(Class<T> clazz, Id idendifier);
	
	public <T extends VO> Long lastIdentifier(Class<T> clazz);
	
}
